package org.sjs.dreamfly.biz.personal

import android.content.Intent
import androidx.lifecycle.ViewModelProvider
import android.view.View
import org.sjs.dreamfly.R
import org.sjs.dreamfly.common.base.BaseFragment
import org.sjs.dreamfly.biz.history.HistoryActivity

class PersonalFragment : BaseFragment() {

    companion object {
        fun newInstance() = PersonalFragment()
    }

    private lateinit var viewModel: PersonalViewModel
    private lateinit var btnHistory: View

    override fun requireLayoutId(): Int {
        return R.layout.fragment_personal
    }

    override fun onBindViews() {
        btnHistory = requireView().findViewById(R.id.btn_history)
    }

    override fun onInitViews() {
        btnHistory.setOnClickListener {
            startActivity(Intent(requireContext(), HistoryActivity::class.java))
        }
    }

    override fun onLoadData() {
        viewModel = ViewModelProvider(this)[PersonalViewModel::class.java]
    }

}